<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFansTable extends Migration
{
    const TABLE = 'fans';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // 创建表
        Schema::create(self::TABLE, function (Blueprint $table){
            $table->increments('id');
            $table->integer('fan_id')->default(0); // 粉丝id
            $table->integer('star_id')->default(0); // 明星id
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        // 删除表
        Schema::dropIfExists(self::TABLE);
    }
}
